<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/modules/cms/front/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>密码修改</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="decorator" content="ems_${site.theme}_front" />
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="${site.description}" />
<meta name="keywords" content="${site.keywords}" />
<link rel="stylesheet" href="${ctxStatic}/sdsng/lib/weui.min.css">
<link rel="stylesheet" href="${ctxStatic}/sdsng/css/jquery-weui.css">
<link rel="stylesheet" href="${ctxStatic}/sdsng/css/style.css">
</head>
<body ontouchstart>
<!--主体-->
<header class="wy-header">
  <div class="wy-header-icon-back"><span></span></div>
  <div class="wy-header-title">密码修改</div>
</header>

<form id="chgPwdForm" action="${ctx }/chgPwd">
<input type="hidden" name="siteId" value="${site.id }">
<div class="weui-content">
  <div class="weui-cells weui-cells_form wy-address-edit">
  
  <div class="header">
		<div id="messageBox" class="alert alert-error ${empty message ? 'hide' : ''}"><!-- <button data-dismiss="alert" class="close">×</button> -->
			<label id="loginError"><font color="red">${message}</font></label>
		</div>
	</div>
  
  <!----有验证码的情况---->
  <!--  <div class="weui-cell weui-cell_vcode">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">手机号</label></div>
      <div class="weui-cell__bd"><input class="weui-input" type="tel" placeholder="请输入手机号"></div>
      <div class="weui-cell__ft"><button class="weui-vcode-btn">获取验证码</button></div>
    </div>
    <div class="weui-cell weui-cell_vcode">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">验证码</label></div>
      <div class="weui-cell__bd"><input class="weui-input" type="number" placeholder="请输入验证码"></div>
      <div class="weui-cell__ft"><img class="weui-vcode-img" src="./images/vcode.jpg"></div>
    </div>-->
    <div class="weui-cell">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">原密码</label></div>
      <div class="weui-cell__bd"><input class="weui-input" type="password" id="password" name="password" placeholder="输入原密码"></div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">新密码</label></div>
      <div class="weui-cell__bd"><input class="weui-input" type="password" id="newPwd" name="newPwd" placeholder="请输入新密码"></div>
    </div>
    <div class="weui-cell">
      <div class="weui-cell__hd"><label class="weui-label wy-lab">确认新密码</label></div>
      <div class="weui-cell__bd"><input class="weui-input" type="password" id="newPwdCfm" name="newPwdCfm" placeholder="请确认新密码"></div>
    </div>
  </div>
  <!-- <label for="weuiAgree" class="weui-agree">
    <input id="weuiAgree" type="checkbox" class="weui-agree__checkbox" checked="checked">
    <span class="weui-agree__text">阅读并同意<a href="javascript:void(0);">《注册协议》</a></span>
  </label> -->
  <div class="weui-btn-area"><a href="#" onclick="doChgPwd();" class="weui-btn weui-btn_warn" style="background:#1ec80d">提交</a></div>
  <!-- <div class="weui-cells__tips t-c font-12">登陆账号为您输入的用户名或者手机号码</div>
  <div class="weui-cells__tips t-c pd-10"><a href="xieyi.html" class="weui-cell_link font-12">查看注册协议</a></div> -->
  
</div>
</form>

<script src="${ctxStatic}/sdsng/lib/jquery-2.1.4.js"></script> 
<script src="${ctxStatic}/sdsng/lib/fastclick.js"></script>
<script type="text/javascript" src="${ctxStatic}/sdsng/js/jquery.Spinner.js"></script>
<script src="${ctxStatic}/sdsng/js/base.js"></script>
<script>
  $(function() {
    FastClick.attach(document.body);
  });
  
  function doChgPwd()
  {
	  var password = $("#password").val();
	  
	  var newPwd = $("#newPwd").val();
	  var newPwdCfm = $("#newPwdCfm").val();
	  
	  if(!password)
	  {
	  	msg("请输入原密码",3000,"warning");
	  	return;
	  }
	  
	  if(!newPwd)
	  {
	  	msg("请输入新密码",3000,"warning");
	  	return;
	  }
	  
	  if(newPwd.length < 6)
	  {
		  msg("新密码长度不能小于6位",3000,"warning");
		  return;
	  }
	  if(newPwd != newPwdCfm)
	  {
	  	msg("新密码与确认密码不一致，请重新输入",3000,"warning");
	  	return;
	  }
	  
	  document.getElementById("chgPwdForm").submit();
  }
  
</script>

<script src="${ctxStatic}/sdsng/js/jquery-weui.js"></script>
</body>
</html>